package com.qidian.mes.pro.controller;

import com.qidian.mes.pojo.OrderBOM;
import com.qidian.mes.pojo.OrderRequire;
import com.qidian.mes.pro.service.MaterialBOMService;
import com.qidian.mes.pro.service.RequireService;
import com.qidian.mes.util.dot.PagerDTO;
import com.qidian.mes.util.pojo.QdResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @Author: CoolPro
 * @Description:
 * @Time: 2024-04-08 15:23
 **/
@RestController
@RequestMapping("/require")
@CrossOrigin
public class RequireController {
    @Autowired
    private RequireService requireService;
    @GetMapping("/queryById")
    public QdResult findByOrderId(Long woId){
        return requireService.findByOrderId(woId);
    }

    @GetMapping("/queryByRequestId")
    public QdResult findByBomId(Long requestId){
        System.out.println("bomId:"+requestId);
        return requireService.findByRequireId(requestId);
    }

    @GetMapping("/queryByPage")
    public QdResult<PagerDTO<OrderRequire>> queryPager(OrderRequire orderRequire, @RequestParam(defaultValue = "1") int start, @RequestParam(defaultValue = "10") int limit){
        return requireService.queryPager(orderRequire,start,limit);
    }

}
